import { Navigate } from "react-router-dom";

import NotFound from "../views/NotFound";

//======================================================================== 一级路由
import Index from "../views/Index";
import DengLu from "../views/HuangYuDong/HYDDengLu/DengLu"; //登录
//======================================================================== 二级路由
import ShouYe from "../views/HuangYuDong/HYDHome/ShouYe"; //首页
import HuiYi from "../views/HuangYuDong/HYDHuiYi/HuiYi"; //会议室预定
import YuanGong from "../views/HuangYuDong/HYDYuanGong/YuanGong"; //员工
//======================================================================== 三级路由
import WorkBench from "../views/HuangYuDong/HYDHome/WorkBench"; //工作台
import DaiBan from "../views/HuangYuDong/HYDHome/DaiBan"; //日程待办
import HuiYiGuanLi from "../views/HuangYuDong/HYDHuiYi/HuiYiGuanLi"; //会议管理
import YuDingJiLu from "../views/HuangYuDong/HYDHuiYi/YuDingJiLu"; //预定会议
import HuiYiXiangQing from "../views/HuangYuDong/HYDHuiYi/HuiYiXiangQing"; //会议详情
import HuiYiXiuGai from "../views/HuangYuDong/HYDHuiYi/HuiYiXiuGai"; //会议修改
import HuiYiShiXiangQing from "../views/HuangYuDong/HYDHuiYi/HuiYiShiXiangQing"//会议室详情
import HuiYiShiXiuGai from "../views/HuangYuDong/HYDHuiYi/HuiYiShiXiuGai";//会议室修改
import YGHuaMingCe from "../views/HuangYuDong/HYDYuanGong/YGHuaMingCe"; //员工花名册
import YGAdd from "../views/HuangYuDong/HYDYuanGong/YGAdd"; //新增员工

import JiXiao from "../views/HuYueYue/JiXiao/JiXiao";

// 绩效的
import JiHua from "../views/HuYueYue/JiXiao/jihua";
import JinDu from "../views/HuYueYue/JiXiao/jindu";
import DangAn from "../views/HuYueYue/JiXiao/dangan";
import JixiaoDetail from "../views/HuYueYue/JiXiao/shezhi/detail"
import JinDuDetail from "../views/HuYueYue/JiXiao/jindudetail"
import ZhibiaoDetail from "../views/HuYueYue/JiXiao/shezhi/zhibiaodetail"

// 绩效的三级路由
import ZhiBiao from "../views/HuYueYue/JiXiao/shezhi/zhibiao";
import MuBan from "../views/HuYueYue/JiXiao/shezhi/muban";
import JiXiaoSheZhi from "../views/HuYueYue/JiXiao/shezhi/jixiaoshezhi";


import Attendance from '../views/Gml/Attendance/Attendance'
import AttendanceManage from '../views/Gml/Attendance/AttendanceManage'
import AttendanceGroupManage from '../views/Gml/Attendance/attendancemanages/AttendanceGroupManage'
import WorkforceManage from '../views/Gml/Attendance/attendancemanages/WorkforceManage'
import Xz from '../views/Gml/Attendance/attendancemanages/Xz'
import XzBc from '../views/Gml/Attendance/attendancemanages/XzBc'
import AttendanceStatistics from '../views/Gml/Attendance/AttendanceStatistics'
import HolidayManage from '../views/Gml/Attendance/HolidayManage'
import Setup from '../views/Gml/Attendance/Setup'



// 配置路由表
// eslint-disable-next-line import/no-anonymous-default-export
export default [
  {
    path: "/index",
    element: <Index />,
    children: [
      {
        // 首页
        path: "/index/shouye",
        element: <ShouYe></ShouYe>,
        children: [
          { path: "/index/shouye/workbench", element: <WorkBench /> }, // 工作台

          { path: "/index/shouye/daiban", element: <DaiBan /> }, // 日程待办
          {
            path: "/index/shouye",
            element: <Navigate to="/index/shouye/workbench"></Navigate>,
          },
          { path: "*", element: <NotFound /> },
        ],
      },
      { path: "/index/huiyi", 
        element: <HuiYi />,
        children:[
          { path: "/index/huiyi/guanli", element: <HuiYiGuanLi /> }, // 会议室管理

          { path: "/index/huiyi/yuding_jilu", element: <YuDingJiLu /> }, // 会议预订记录
          { path: "/index/huiyi/huiyi_xiangqing", element: <HuiYiXiangQing /> }, // 会议详情
          { path: "/index/huiyi/huiyi_xiugai", element: <HuiYiXiuGai /> }, // 会议修改
          { path: "/index/huiyi/huiyishi_xiangqing", element: <HuiYiShiXiangQing /> }, // 会议详情
          { path: "/index/huiyi/huiyishi_xiugai", element: <HuiYiShiXiuGai /> }, // 会议修改
          { path: "/index/huiyi", element: <Navigate to="/index/huiyi/guanli"></Navigate> },
          { path: "*", element: <NotFound /> },
        ] },
        {
          path: "/index/yuangong",//员工
          element: <YuanGong></YuanGong>,
          children:[
            {path:"/index/yuangong/huamingce",element:<YGHuaMingCe/>},//花名册
            {path:"/index/yuangong/ygadd",element:<YGAdd/>},//花名册
            {path:"/index/yuangong",element:<Navigate to="/index/yuangong/huamingce"></Navigate> },
            {path:"*",element: <NotFound></NotFound>}
          ]
        },
          //  绩效
        // 二级路由
        {
          path:'/index/jixiao',element:<JiXiao/>,
          // 三级路由
          children:[
              {
                  path:'/index/jixiao/jihua',element:<JiHua/>
              },
              {
                  path:'/index/jixiao/jindu',element:<JinDu/>
              },
              {
                  path:'/index/jixiao/dangan',element:<DangAn/>
              },
              {
                path:'/index/jixiao/zhibiao',element:<ZhiBiao/>
              },
              {
                  path:'/index/jixiao/muban',element:<MuBan/>
              },
              {
                  path:'/index/jixiao/jixiaoshezhi',element:<JiXiaoSheZhi/>
              },
              {
                  path:'/index/jixiao/detail',element:<JixiaoDetail/>
              },
              {
                  path:'/index/jixiao/jindudetail',element:<JinDuDetail/>
              },
              {
                  path:'/index/jixiao/zhibiaodetail',element:<ZhibiaoDetail/>
              },
              // 重定向
              {
                  path:"/index/jixiao",element:<Navigate to="/index/jixiao/jihua"/> ,
              },
              // 404界面
              {
                  path:"*",element: <NotFound></NotFound>,
              },
          ]
      },
      {
        path: '/index/attendance',
        element: <Attendance />,
        children: [
            {
                path: '/index/attendance',
                element: <Navigate to='/index/attendance/attendance_manage' />,
            },
            {
                path: '/index/attendance/attendance_manage',
                element: <AttendanceManage />,
                children: [
                    {
                        path: '/index/attendance/attendance_manage',
                        element: <Navigate to='/index/attendance/attendance_manage/attendance_group_manage' />,
                    },
                    {
                        path: '/index/attendance/attendance_manage/attendance_group_manage',
                        element: <AttendanceGroupManage />,
                    },
                    {
                        path: '/index/attendance/attendance_manage/xz',
                        element: <Xz />,
                    },
                    {
                        path: '/index/attendance/attendance_manage/xzbc',
                        element: <XzBc/>
                    },
                    {
                        path: '/index/attendance/attendance_manage/workforce_manage',
                        element: <WorkforceManage />,
                    }
                ]
            },
            {
                path: '/index/attendance/attendance_statistic',
                element: <AttendanceStatistics />,
            },
            {
                path: '/index/attendance/holiday_manage',
                element: <HolidayManage />,
            }
            ,
            {
                path: '/index/attendance/attendance_setup',
                element: <Setup />,
            }
        ]
    }
    ,
      { path: "/index", element: <Navigate to="/index/shouye"></Navigate> },
      { path: "*", element: <NotFound /> },
    ],
    
  },
  {
    path: "/denglu",
    element: <DengLu></DengLu>,
  },
  { path: "/", element: <Navigate to="/denglu"></Navigate> },
  { path: "*", element: <NotFound /> },
];
